<template>
  <div>
    <div class="box">
      <form action="" >
        <input type="text" name="username" v-model.trim.lazy="form.username">
        <input type="text" name="password" v-model.trim.lazy="form.password">
        <button @click.prevent="print">点击打印</button>
      </form>
    </div>
  </div>
</template>

<script>
export default {
  data(){
    return{
      form:{
        username:'',
        password:''
      }
    }
  },
  methods:{
    // 按钮点击事件
    print(){
      console.log(this.form.username);
      console.log(this.form.password);
    }
  }
}
</script>

<style>

</style>
